
#pragma once

#include <stddef.h>

/*
 * declaring offsetof
 */
#ifndef offsetof
#define offsetof(st, m)   ( (char *)&((st *)(0))->m - (char *)&((st *)(0))
#endif

/*
 * fixing msvc stdbool bug - msvc does not recognize bool as built-in type,
 * despite all C99-compliant compilers do
 */
#ifdef _MSC_VER
#define _Bool   int
#include <fixincludes/stdbool.h>
#else
/* assume this compiler is sane enough */
#include <stdbool.h>
#endif

/*
 * enables heap allocations debug
 */
#if defined(_MSC_VER) && defined(_DEBUG)
//#define QL_ENABLE_MEM_DEBUG
#endif


/* fixing msvc inline bug */
#ifdef _MSC_VER
#define INLINE __inline
#else
#define INLINE inline
#endif

#ifdef _DEBUG
#define QL_GC_DEBUG
#endif
